package org.csu.jpetstore_users_backend_pj.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.csu.jpetstore_users_backend_pj.entity.Product;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ProductMapper extends BaseMapper<Product> {
    @Select("SELECT productid, categoryid AS categoryId, name FROM product WHERE name LIKE CONCAT('%', #{keywords}, '%')")
    List<Product> searchProductList(@Param("keywords") String keywords);
}
